package com.castle.fortress.admin.oa.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.castle.fortress.admin.oa.entity.HolidayTypeEntity;
import com.castle.fortress.admin.oa.entity.UserHolidaySettingEntity;
import com.castle.fortress.admin.oa.dto.UserHolidaySettingDto;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;

import java.util.ArrayList;
import java.util.Map;
import java.util.List;

/**
 * 用户假期余额 服务类
 *
 * @author whc
 * @since 2022-11-03
 */
public interface UserHolidaySettingService extends IService<UserHolidaySettingEntity> {

    /**
     * 分页展示用户假期余额列表
     *
     * @param page
     * @param userHolidaySettingDto
     * @return
     */
    IPage<UserHolidaySettingDto> pageUserHolidaySetting(Page<UserHolidaySettingDto> page, UserHolidaySettingDto userHolidaySettingDto);


    /**
     * 展示用户假期余额列表
     *
     * @param userHolidaySettingDto
     * @return
     */
    List<UserHolidaySettingDto> listUserHolidaySetting(UserHolidaySettingDto userHolidaySettingDto);

    /**
     * 用户假期余额列表关联类型返回
     * @param userHolidaySettingDto
     * @return
     */
    List<UserHolidaySettingDto> listUserHolidaySettingExtends(UserHolidaySettingDto userHolidaySettingDto);


    IPage<UserHolidaySettingDto> pageUserHolidaySettingExtends(Page<UserHolidaySettingDto> page, UserHolidaySettingDto userHolidaySettingDto);

    /**
     * 异步生成单个用户的请假余额
     * @param userId
     * @param isCover
     */
    void asyncGenerateUserSetting(Long userId, boolean isCover);

    /**
     * 异步更新 某种请假类型的所有用户的余额
     * @param holidayTypeEntity
     */
    void asyncUpdateUserSetting(HolidayTypeEntity holidayTypeEntity);

    /**
     * 异步删除
     * @param ids
     */
    void asyncRemoveUserSetting(List<Long> ids);

    /**
     * 新建类型 异步新增所有用户余额
     * @param holidayTypeEntity
     */
    void asyncNewType(HolidayTypeEntity holidayTypeEntity);

}
